package cn.tedu.bonfire.admin.account.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
public class UserAddNewDTO implements Serializable {
    /*
     * 用户id
     */
    private Long id;

    /*
     * 用户名
     */
    @NotNull(message = "用户名不能为空")
    @Pattern(regexp = "^[a-zA-Z]{1}[a-zA-Z0-9_]{3,14}$",
            message = "用户名必须由4~15长度的字母、数组、下划线组成，且第1个字符必须是字母")
    @ApiModelProperty(value = "用户名", required = true, example = "root")
    private String username;

    /*
     * 用户密码
     */
    @NotNull(message = "密码不能为空")
    @Pattern(regexp = "^.{4,15}$",
            message = "密码必须是4~15长度的字符组成")
    @ApiModelProperty(value = "密码", required = true, example = "123456")
    private String password;

    /*
     * 用户昵称
     */
    @Pattern(regexp = "^.{1,10}$", message = "昵称应为1-10位")
    @ApiModelProperty(value = "昵称", required = true)
    private String nickname;



    /*
     * 用户电话
     */
    @NotNull(message = "手机号不能为空")
    @Pattern(regexp = "^\\d{11}$",
            message = "手机号码必须是11位的纯数字")
    @ApiModelProperty(value = "手机号码", required = true, example = "13800138008")
    private String phone;


    /*
     * 用户状态
     */
    @NotNull(message = "状态不能为空")
//    @Pattern(regexp = "^(0|1)+$",
//            message = "角色必须是0-1的整数")
    @ApiModelProperty(value = "状态", required = true)
    private Integer enable;


    /**
     * 用户角色
     */
    @NotNull(message = "角色不能为空")
//    @Pattern(regexp = "^[1-5]+$",
//            message = "角色必须是1-5的整数")
    @ApiModelProperty(value = "角色", required = true)
    private Long roleId;
}
